package demo3;

class Derived extends Base{
    public void test1(){
        System.out.println(a);
        System.out.println(b);
    }
}

public class Test {
    //protected 关键字
    //同一包，同一类
    public static void main1(String[] args) {
        Base base = new Base();
        base.test();
    }

    //同一包，不同类
    public static void main(String[] args) {
        Derived derived = new Derived();
        derived.test1();
    }

    //不同包不同类的代码在 TestProcted 文件中
}
